package com.itheima.demo04;

import java.util.HashSet;

public class Demo {

    public static void main(String[] args) {

        HashSet<Student> hashSet = new HashSet<>();

        Student s1 = new Student("张留参",23);
        Student s2 = new Student("林俊杰",40);
        Student s3 = new Student("周星驰",61);
        Student s4 = new Student("陈奕迅",43);
        Student s5 = new Student("陈奕迅",43);

        hashSet.add(s1);
        hashSet.add(s2);
        hashSet.add(s3);
        hashSet.add(s4);
        hashSet.add(s5);

        hashSet.forEach(student -> System.out.println(student));
    }
}
